import type { RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      // 首页
      { path: '', component: () => import('pages/HomePage.vue') },
      // 房源管理
      { path: 'house', component: () => import('pages/HouseResourcePage.vue') },
      // 租金管理
      { path: 'rent', component: () => import('pages/RentPage.vue') },
      // 维修管理
      { path: 'repair', component: () => import('pages/RepairPage.vue') },
      // 投诉管理
      { path: 'complaint', component: () => import('pages/ComplaintPage.vue') },
      // 租客管理
      { path: 'tenant', component: () => import('pages/TenantPage.vue') },
      // 用户管理
      { path: 'user', component: () => import('pages/UserPage.vue') },
      // 订餐管理
      { path: 'meal-order', component: () => import('pages/MealOrderingPage.vue') },
      // 投放管理
      { path: 'advert', component: () => import('pages/AdvertisingPage.vue') }
    ]
  },
  {
    path: '/data-collection',
    meta: { noRequiresAuth: true },
    component: () => import('layouts/DataCollectionLayout.vue'),
    children: [
      // 首页
      { path: '', component: () => import('pages/DataCollectionPage.vue') }
    ]
  },
  {
    path: '/questionnaire',
    meta: { noRequiresAuth: true },
    component: () => import('pages/QuestionnairePage.vue')
  },
  {
    path: '/login',
    name: 'Login',
    meta: { noRequiresAuth: true },
    component: () => import('pages/LoginPage.vue')
  },

  // Always leave this as last one,
  // but you can also remove it
  {
    path: '/:catchAll(.*)*',
    component: () => import('pages/ErrorNotFound.vue')
  }
]
export default routes
